from alg import Solution

solver = Solution()

# 测试用例: (输入, 预期输出)
test_cases = [
    (2736, 7236),
    (9973, 9973),
    (10, 10),
    (9, 9),
    (98765, 98765),
    (12345, 52341),
    (1993, 9913),
    (109, 901),
    (98368, 98863),
    (10000, 10000),
    (120, 220),
    (9919, 9991),
    (9876, 9876),
    (1234, 4231)
]

print("--- 运行测试 ---")
all_passed = True

for i, (num_input, expected) in enumerate(test_cases):
    actual = solver.maximumSwap(num_input)

    print(f"用例 {i + 1}: 输入={num_input}")
    print(f"  预期: {expected}")
    print(f"  实际: {actual}")

    if actual == expected:
        print("  通过")
    else:
        print("  失败 ")
        all_passed = False
    print("-" * 20)

